package com.unknownman.block.dto;

import com.unknownman.block.entity.TChainConfig;
import com.unknownman.block.entity.TContractConfig;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * 链和合约配置复合对象
 */
@Data
@NoArgsConstructor
public class ChainContractComposition extends TChainConfig {

    private List<TContractConfig> contractList;

    public ChainContractComposition(TChainConfig chainConfig, List<TContractConfig> contractList) {
        if (chainConfig != null){
            BeanUtils.copyProperties(chainConfig, this);
        }
        this.contractList = contractList;
    }
    public ChainContractComposition(TChainConfig chainConfig) {
        if (chainConfig != null){
            BeanUtils.copyProperties(chainConfig, this);
        }
    }


}
